import java.util.Random;
import java.util.Scanner;

public class guess {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Random random = new Random();
        int randomNum = random.nextInt(100);

        while(true){
            System.out.println("请输入猜的数字");

            int num = scan.nextInt();
            if(num == randomNum){
                System.out.println("猜对了！");
                break;
            }else if(num > randomNum){
                System.out.println("猜大了！");
            }else{
                System.out.println("猜小了！");
            }
        }
        scan.close();

    }
}
